package com.panda.utils;

public class Base64 {

	/**
	 * 对参数进行base64编码
	 * @param s
	 * @return
	 */
	public static String getBASE64(String s) {
		if (s == null)
			return null;
		return new String(org.apache.commons.codec.binary.Base64.encodeBase64(s.getBytes()));
	}

	/**
	 * 对产生进行base64解码
	 * @param s
	 * @return
	 */
	public static String getFromBASE64(String s) {
		if (s == null) return null;
		return new String(org.apache.commons.codec.binary.Base64.decodeBase64(s.getBytes()));
	}
}
